/*
	@file: log/source/formatter/Formatter.cpp
	@author: Wolfhead
 */
#include "formatter/Formatter.h"


namespace logger
{

Formatter::Formatter()
{

}

Formatter::~Formatter()
{

}

FormatterPtr Formatter::set_next(FormatterPtr formatter_ptr)
{
	m_next_formatter_ptr = formatter_ptr;
	return shared_from_this();
}

void Formatter::format(
	LogDataPtr data_ptr,
	std::string & output)
{
	do_format(data_ptr, output);

	if (m_next_formatter_ptr)
	{
		m_next_formatter_ptr->format(data_ptr, output);
	}
}

}//namespace logger
